package com.demo.service2.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 夜曲sin
 * @create 2021/6/23
 */
@RestController
@RequestMapping("test")
public class TestController {

    @Value("${common.name}")
    private String name;


    // 查看从nacos拉取到的配置：http://localhost:56020/test/name
    @GetMapping("/name")
    public String name() {
        return name;
    }
}
